package com.example.service;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.example.dto.BusinessUserDTO;
import com.example.dto.PasswordDTO;
import com.example.dto.SysQueryUserDTO;
import com.example.dto.SysUserDTO;
import com.example.entity.BusinessUserEntity;
import com.example.entity.SysUserEntity;
import com.example.model.page.PageData;
import com.example.mybatis.service.BaseService;
import com.example.security.UserDetail;

import java.util.List;
import java.util.Map;

/**
 * 系统用户服务接口
 */
public interface SysUserService extends BaseService<SysUserEntity> {

    List<Long> getUserIdListByDeptId(List<Long> deptIdList);

    int getCountByDeptId(Long deptId);

    SysUserEntity getSysUsername(String username);

    List<Long> getUserRoleIds(Long id);

    /**
     * 根据用户名获取用户信息
     *
     * @param username 用户名
     * @return 用户DTO
     */
    UserDetail getByUsername(String username);


    void updatePassword(PasswordDTO passwordDTO);

    PageData<SysUserDTO> selectPage(SysQueryUserDTO sysQueryUserDTO);

    SysUserDTO getId(Long id);

    void update(SysUserDTO dto);

    void save(SysUserDTO dto);
    void saveThirdOauth2(SysUserDTO dto);

    List<SysUserEntity> selectList(QueryWrapper<SysUserEntity> queryWrapper);

    UserDetail getByBusinessUsername(String username);

    BusinessUserEntity businessUsernameExist(String openid);

    void createBusinessUser(BusinessUserDTO businessUserDTO);

    SysUserEntity selectByTenantId(Long tenantId);

    void deleteIds(List<Long> ids);

}